home *** CD-ROM | disk | FTP | other *** search
/ NetNews Offline 2 / NetNews Offline Volume 2.iso / news / comp / lang / c++-part1 / 4770 < prev    next >
Encoding:
Internet Message Format  |  1996-08-06  |  1.3 KB

  1. Path: news1.h1.usa.pipeline.com!usenet
  2. From: grantp@usa.pipeline.com(Pete)
  3. Newsgroups: comp.lang.c++
  4. Subject: Re: SPARCompiler error
  5. Date: 1 Feb 1996 00:13:25 GMT
  6. Organization: Kalevi, Inc.
  7. Message-ID: <4ep0j5$ktd@news1.usa.pipeline.com>
  8. NNTP-Posting-Host: pipe7.h1.usa.pipeline.com
  9. X-PipeUser: grantp
  10. X-PipeHub: usa.pipeline.com
  11. X-PipeGCOS: (Pete)
  12. X-Newsreader: Pipeline USA v3.3.0
  13.  
  14. On Jan 31, 1996 15:21:34 in article <SPARCompiler error>,
  15. 'mkt@isun04.inf.uni-jena.de (Tilo Koerbs)' wrote: 
  16.  
  17.  
  18. >The SPARCompiler 4.0x has a nice incompatibility between 
  19. >C++ and ANSI-C 'optimized away'. The C++ compiler behaves 
  20. >like an ANSI-C compiler here: 
  21. >cout << (1 ? 'a' : 'b') << endl; 
  22. >Question: What is the output on the screen? 
  23. >In C++ it is an 'a'. 
  24. >Not so the SPARCompiler. It prints out a '97'!!! 
  25. >This is exactly what ANSI-C compiler do! They do an integral promotion 
  26.  
  27. Does an ANSI-C compiler really print out a '97'??  I would expect 
  28. it to print something like: 
  29. Error.  Undeclared identifier: cout. 
  30. Error. Undeclared identifier:  endl; 
  31. Syntax error. Binary shift.... 
  32.  
  33. >on the second and third operand of ?: 
  34. >C++ does no promotion. 
  35. >Who can tell these SPARCompiler-Guys about the error? 
  36.  
  37. -- 
  38. Pete Grant 
  39. Kalevi, Inc. 
  40. Object Oriented Software Development
  41.